import request from '@/utils/request'

// 获取面经列表的方法
export const articleListAPI = ({ current, sorter }) => {
  return request.get('/h5/interview/query', {
    params: {
      current: current,
      pageSize: 10, // 每页10条数据
      sorter: sorter // weight_desc表示获取推荐数据 || null表示获取最新数据
    }
  })
}

export const getArticleDetail = (id) => {
  return request.get('/h5/interview/show', {
    params: {
      id
    }
  })
}

export const updateLikeAndCollect = ({ id, optType }) => {
  return request.post('/h5/interview/opt', {
    id,
    optType: optType // 1喜欢  2收藏
  })
}

export const collectAndLikeListAPI = ({ page, optType }) => {
  return request.get('/h5/interview/opt/list', {
    params: {
      page,
      optType: optType
    }
  })
}
